<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>订单详情</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
            padding-top: 20px;
        }
        .order-container {
            max-width: 1200px;
            margin: 0 auto;
        }
        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }
        .order-card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            margin-bottom: 30px;
            overflow: hidden;
        }
        .order-title {
            padding: 20px;
            border-bottom: 1px solid #eee;
            font-weight: 600;
        }
        .product-card {
            display: flex;
            padding: 20px;
            border-bottom: 1px solid #eee;
            transition: all 0.3s ease;
        }
        .product-card:hover {
            background-color: #f9f9f9;
        }
        .product-img {
            width: 120px;
            height: 120px;
            object-fit: cover;
            border-radius: 8px;
            margin-right: 20px;
        }
        .product-info {
            flex: 1;
        }
        .product-name {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }
        .product-price {
            color: #e63946;
            font-weight: 600;
            font-size: 16px;
        }
        .product-type {
            display: inline-block;
            background: #f1f1f1;
            color: #666;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 12px;
            margin-top: 8px;
        }
        .order-summary {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            padding: 20px;
        }
        .summary-title {
            font-weight: 600;
            margin-bottom: 20px;
        }
        .summary-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
        }
        .total-row {
            font-weight: 600;
            font-size: 18px;
            padding-top: 10px;
            border-top: 1px solid #eee;
        }
    </style>
</head>
<body>
<div class="order-container">
    <!-- 订单头部 -->
    <div class="order-header">
        <h2>订单详情</h2>
        <a href="${pageContext.request.contextPath}/orders/list?uid=${uid}" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left"></i> 返回订单列表
        </a>
    </div>

    <!-- 订单基本信息 -->
    <div class="order-card">
        <div class="order-title">订单信息</div>
        <div class="p-4">
            <div class="row mb-2">
                <div class="col-md-3"><strong>订单编号:</strong></div>
                <div class="col-md-9">${ordersDetails.odid}</div>
            </div>
            <div class="row mb-2">
                <div class="col-md-3"><strong>下单时间:</strong></div>
                <div class="col-md-9">${orders.createtime}</div>
            </div>
            <div class="row">
                <div class="col-md-3"><strong>订单状态:</strong></div>
                <div class="col-md-9">
                    <c:choose>
                        <c:when test="${orders.paystatus eq 1}">
                            <span class="badge bg-success">已支付</span>
                        </c:when>
                        <c:when test="${order.paystatus eq 0}">
                            <span class="badge bg-warning text-dark">待支付</span>
                        </c:when>
                        <c:otherwise>
                            <span class="badge bg-secondary">${orders.paystatus}</span>
                        </c:otherwise>
                    </c:choose>
                </div>
            </div>
        </div>
    </div>

    <!-- 商品列表 -->
    <div class="order-card">
        <div class="order-title">商品清单</div>
            <div class="product-card">
                <img src="${ordersDetails.img}" alt="${ordersDetails.gname}" class="product-img">
                <div class="product-info">
                    <div class="product-name">${ordersDetails.gname}</div>
                    <div class="product-price">¥${ordersDetails.gprice}</div>
                    <span class="product-type">${ordersDetails.gtype}</span>
                </div>
            </div>

    </div>

    <!-- 订单汇总 -->
    <div class="order-summary">
        <div class="summary-title">订单汇总</div>
        <div class="summary-row">
            <span>商品总价:</span>
            <span>¥${orders.paymoney}</span>
        </div>

        <div class="summary-row total-row">
            <span>实付金额:</span>
            <span>¥${orders.paymoney}</span>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>